//index.js
//获取应用实例
const app = getApp()
Page({
  data: {
    motto: 'Hello World',
    userInfo: {},
    hasUserInfo: false,
    canIUse: wx.canIUse('button.open-type.getUserInfo'),
    home: 'http://www.gzfhcs.com/images/wedding/1-1.jpg'
  },
  getLocation:function(){
    wx.getLocation({
      type: 'wgs84', 
      success: function (res) {
        wx.openLocation({//​使用微信内置地图查看位置。
          latitude: 31.079681,//要去的纬度-地址
          longitude: 106.556771,//要去的经度-地址
          name: "营山县天胜大酒店",
          address: "南充市营山县朗池镇兴隆路258号天胜大酒店"
        })
      },
      fail:function(){
        wx.getSetting({
          success: (res) => {
            let authSetting = res.authSetting
            if (authSetting['scope.userLocation']) {
              // 已授权
            } else {
              wx.showModal({
                title: '您未开启地理位置授权',
                content: '请点击确定',
                success: res => {
                  if (res.confirm) {
                    wx.openSetting()
                  }
                }
              })
            }
          }
        })      
      }
    })
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function (options) {
    
  },
  onShareAppMessage: function(){
    
  }
})
